<!--
 * @Author: 雷宇航
 * @Date: 2021-07-13 15:11:01
 * @LastEditTime: 2021-07-13 16:23:22
 * @LastEditors: 雷宇航
 * @Description: 
 * @FilePath: \icm-vue\src\components\bpm\bpmStatusTagComponent.vue
-->
<template>
  <div>
    <a-tag v-if="record.bpmStatus == '1'" style="margin-right: 0" :color="bpmStatusColorFun()">{{ text }}</a-tag>
    <a-tag v-if="record.bpmStatus == '2'" style="margin-right: 0" :color="bpmStatusColorFun()">{{ text }}</a-tag>
    <a-tag v-if="record.bpmStatus == '3'" style="margin-right: 0" :color="bpmStatusColorFun()">{{ text }}</a-tag>
    <a-tag v-if="record.bpmStatus == '4'" style="margin-right: 0" :color="bpmStatusColorFun()">{{ text }}</a-tag>
  </div>
</template>

<script>
import { initDictOptions } from '@/components/dict/JDictSelectUtil'
export default {
  name:"bpmStatusTagComponent",
  props: {
    record: {
      type: Object,
      default: () => {},
      required: true,
    },
    text: {
      type: String,
      default: () => {},
      required: true,
    },
  },
  data(){
    return {
      bpmStatusColor:[]
    }
  },
  computed:{
    
  },
  methods:{
    bpmStatusColorFun(){
      let res = ''
      this.bpmStatusColor.forEach((v)=>{
        if(this.record.bpmStatus == v.value){
          res = v.text
        }
      })
      return res
    }
  },
  mounted(){
    initDictOptions('bpm_status_color').then((res) => {
        if (res.success) {
          this.bpmStatusColor = res.result
        }
      })
  },
}
</script>

<style>
</style>
